<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/23 0023
 * Time: 14:40
 */

namespace Admin\Controller;

class PhotoController extends CommonController{
    public function index()
    {
        $photos = $this->photo->select();
        $this->assign('photos',$photos);
        $this->display();
    }


    public function add()
    {
        if(IS_POST){
            $time =I('POST.time');
            $this->photo->create();
            $this->photo->time = strtotime($time);
            $this->photo->add();
            $this->success('恭喜你，新增相册成功',U('index'));
        }else{
            $this->display();
        }
    }
}